Data is written to a conventional nonvolatile memory based solid-state drive by programming erased blocks. The blocks are erased in the background and made available to a program operation, or are erased on-demand when the programming operation is initiated. As a nonvolatile media, Flash memory holds the data when power is off. The data programmed before the power is switched off can still be read out from the Flash memory after the power is switched back on. However, when the power is unexpectedly cut off during the program operation or the erase operation, the data integrity of the solid-state drive can be in danger. For example, the data being written may be unrecoverable. Furthermore, since the solid-state drives use a flash translation layer to manage a mapping between logical sectors and physical locations in one or more nonvolatile memory devices, a power failure can render the map incoherent and potentially corrupt a much larger portion of the drive.